$(function () {


    $("#generateUser").click(function () {
        var userGroup = $("#user_group").val();
        var userNumber = $("#userNumber").val();
        if (userNumber == "") {
            layer.alert('数字不能为空', {icon: 2});
        } else {
            layer.confirm('生成' + userNumber + '个' + userGroup + '用户', {icon: 3, title: '确认'}, function (data) {
                layer.alert('生成成功', {icon: 1});
            });
        }
    });

    $("#deleteSelected").click(function () {
        layer.confirm('删除选中?', {icon: 2, title: '删除'}, function () {

        });
    });

    $(".badge-danger").click(function () {
        layer.confirm('删除此用户', {icon: 2, title: '删除'}, function () {

        })
    });
    
    $("#groupAdd").click(function () {
        /*layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['420px', '240px'], //宽高
            content: '/groupprompt.html'
        });*/

        layer.open({
            type: 2,
            title: '',
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['600px', '480px'], //宽高
            content: ['groupprompt.html','no']
        });


    });


});

$("#j-shiyan").hover(function(){
    $("#j-shiyan").attr("fill","#e88736");
},function(){
    $("#j-shiyan").attr("fill","#ec9b57");
},function(){
    alert("haha");
});
// wait until all the resources are loaded
window.addEventListener("load", findSVGElements, false);
function setup(document){
    //do something with svg document
}
function getSubDocument(embedding_element)
{
    if (false&&embedding_element.contentDocument) 
    {
        return embedding_element.contentDocument;
    } 
    else 
    {
        var subdoc = null;
        try {
            subdoc = embedding_element.getSVGDocument();
        } catch(e) {}
        return subdoc;
    }
}
function findSVGElements(){
    console.log(getSubDocument(document.getElementById("hbmap")));
}



